#include "_head_unsort_loop.h"

#define PATH "./data.txt"

void ls(void* node)
{
	printf("%d ", *(int*)(((Node_t*)node)->data));
}

int cmp_int(const void* c1, const void* c2)
{
	return *(int*)(((Node_t*)c1)->data) - *(int*)c2;
}

void mod_int(void* m1, void* m2)
{
	memcpy(((Node_t*)m1)->data, m2, ((Node_t*)m1)->size);
}

int main()
{
	Node_t* list_head = NULL;
	init(&list_head, sizeof(int));
	list_read(list_head, PATH);
	print(list_head, ls);
	int i = 0;
	for(; i < 10; i++)
	{
//		push_back(list_head, &i);
	}

//	int tmp = 777;
//	int key = 7;
//	push_front(list_head, &tmp);

//	push_back(list_head, &tmp);

//	push_pos(list_head, 3, &tmp);

//	print(list_head, ls);
	//printf("find_front key : 7 = ");
	//ls(find_front(list_head, &key, cmp_int));
	//putchar(10);

	//list_head->next = reversal_list(list_head->next);

	//print(list_head, ls);
//	Node_t* findlist = NULL;
//	findlist = find_All(list_head, &tmp, cmp_int);
//	int mod_tmp = 10086;
//	mod_All(list_head, &tmp, cmp_int, &mod_tmp, mod_int);
	//mod_back(list_head, &tmp, cmp_int, &mod_tmp, mod_int);
	//print(findlist, ls);
//	mod_pos(list_head, 1, &mod_tmp, mod_int);
//	pop_back(list_head, &mod_tmp, cmp_int);
/*	print(list_head, ls);
	pop_All(list_head, &mod_tmp, cmp_int);
	print(list_head, ls);
	pop_pos(list_head, 4);
	print(list_head, ls);
//	list_write(list_head, PATH);*/
	destory(list_head);
	free(list_head);
	return 0;
}
